package lingou.homework.postbar.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lingou.homework.postbar.domain.Post;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface PostMapper extends BaseMapper<Post> {
    @Update("update post set likes = likes + #{count} where postID = #{postID}")
    void addLike(@Param("postID") long postId,
                 @Param("count") int count);
    @Update("update post set dislikes = dislikes + #{count} where postID = #{postID}")
    void addDislike(long postId, int count);
}
